3.1.13 \(\int (d+c d x)^2 (a+b \tanh ^{-1}(c x)) \, dx\) [13]

Optimal. Leaf size=71 \[ \frac {2}{3} b d^2 x+\frac {b d^2 (1+c x)^2}{6 c}+\frac {d^2 (1+c x)^3 \left (a+b \tanh ^{-1}(c x)\right )}{3 c}+\frac {4 b d^2 \log (1-c x)}{3 c} \]

[Out]

2/3*b*d^2*x+1/6*b*d^2*(c*x+1)^2/c+1/3*d^2*(c*x+1)^3*(a+b*arctanh(c*x))/c+4/3*b*d^2*ln(-c*x+1)/c

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {6063, 641, 45} \begin {gather*} \frac {d^2 (c x+1)^3 \left (a+b \tanh ^{-1}(c x)\right )}{3 c}+\frac {b d^2 (c x+1)^2}{6 c}+\frac {4 b d^2 \log (1-c x)}{3 c}+\frac {2}{3} b d^2 x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + c*d*x)^2*(a + b*ArcTanh[c*x]),x]

[Out]

(2*b*d^2*x)/3 + (b*d^2*(1 + c*x)^2)/(6*c) + (d^2*(1 + c*x)^3*(a + b*ArcTanh[c*x]))/(3*c) + (4*b*d^2*Log[1 - c*
x])/(3*c)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 641

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c/e)*x)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rule 6063

Int[((a_.) + ArcTanh[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)*((a + b
*ArcTanh[c*x])/(e*(q + 1))), x] - Dist[b*(c/(e*(q + 1))), Int[(d + e*x)^(q + 1)/(1 - c^2*x^2), x], x] /; FreeQ
[{a, b, c, d, e, q}, x] && NeQ[q, -1]

Rubi steps

\begin {align*} \int (d+c d x)^2 \left (a+b \tanh ^{-1}(c x)\right ) \, dx &=\frac {d^2 (1+c x)^3 \left (a+b \tanh ^{-1}(c x)\right )}{3 c}-\frac {b \int \frac {(d+c d x)^3}{1-c^2 x^2} \, dx}{3 d}\\ &=\frac {d^2 (1+c x)^3 \left (a+b \tanh ^{-1}(c x)\right )}{3 c}-\frac {b \int \frac {(d+c d x)^2}{\frac {1}{d}-\frac {c x}{d}} \, dx}{3 d}\\ &=\frac {d^2 (1+c x)^3 \left (a+b \tanh ^{-1}(c x)\right )}{3 c}-\frac {b \int \left (-2 d^3+\frac {4 d^2}{\frac {1}{d}-\frac {c x}{d}}-d^2 (d+c d x)\right ) \, dx}{3 d}\\ &=\frac {2}{3} b d^2 x+\frac {b d^2 (1+c x)^2}{6 c}+\frac {d^2 (1+c x)^3 \left (a+b \tanh ^{-1}(c x)\right )}{3 c}+\frac {4 b d^2 \log (1-c x)}{3 c}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 92, normalized size = 1.30 \begin {gather*} \frac {d^2 \left (6 a c x+6 b c x+6 a c^2 x^2+b c^2 x^2+2 a c^3 x^3+2 b c x \left (3+3 c x+c^2 x^2\right ) \tanh ^{-1}(c x)+6 b \log (1-c x)+b \log \left (1-c^2 x^2\right )\right )}{6 c} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + c*d*x)^2*(a + b*ArcTanh[c*x]),x]

[Out]

(d^2*(6*a*c*x + 6*b*c*x + 6*a*c^2*x^2 + b*c^2*x^2 + 2*a*c^3*x^3 + 2*b*c*x*(3 + 3*c*x + c^2*x^2)*ArcTanh[c*x] +
 6*b*Log[1 - c*x] + b*Log[1 - c^2*x^2]))/(6*c)

________________________________________________________________________________________

Maple [A]
time = 0.15, size = 102, normalized size = 1.44

method result size
derivativedivides \(\frac {\frac {d^{2} \left (c x +1\right )^{3} a}{3}+\frac {d^{2} b \arctanh \left (c x \right ) c^{3} x^{3}}{3}+d^{2} b \arctanh \left (c x \right ) c^{2} x^{2}+b c \,d^{2} x \arctanh \left (c x \right )+\frac {b \,d^{2} \arctanh \left (c x \right )}{3}+\frac {d^{2} b \,c^{2} x^{2}}{6}+b c \,d^{2} x +\frac {4 d^{2} b \ln \left (c x -1\right )}{3}}{c}\) \(102\)
default \(\frac {\frac {d^{2} \left (c x +1\right )^{3} a}{3}+\frac {d^{2} b \arctanh \left (c x \right ) c^{3} x^{3}}{3}+d^{2} b \arctanh \left (c x \right ) c^{2} x^{2}+b c \,d^{2} x \arctanh \left (c x \right )+\frac {b \,d^{2} \arctanh \left (c x \right )}{3}+\frac {d^{2} b \,c^{2} x^{2}}{6}+b c \,d^{2} x +\frac {4 d^{2} b \ln \left (c x -1\right )}{3}}{c}\) \(102\)
risch \(\frac {d^{2} \left (c x +1\right )^{3} b \ln \left (c x +1\right )}{6 c}-\frac {d^{2} c^{2} x^{3} b \ln \left (-c x +1\right )}{6}+\frac {d^{2} c^{2} x^{3} a}{3}-\frac {d^{2} c b \,x^{2} \ln \left (-c x +1\right )}{2}+d^{2} c a \,x^{2}+\frac {d^{2} c b \,x^{2}}{6}-\frac {d^{2} b x \ln \left (-c x +1\right )}{2}+d^{2} a x +b \,d^{2} x -\frac {b \,d^{2} \ln \left (-c x +1\right )}{6 c}+\frac {4 d^{2} b \ln \left (c x -1\right )}{3 c}\) \(148\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*d*x+d)^2*(a+b*arctanh(c*x)),x,method=_RETURNVERBOSE)

[Out]

1/c*(1/3*d^2*(c*x+1)^3*a+1/3*d^2*b*arctanh(c*x)*c^3*x^3+d^2*b*arctanh(c*x)*c^2*x^2+b*c*d^2*x*arctanh(c*x)+1/3*
b*d^2*arctanh(c*x)+1/6*d^2*b*c^2*x^2+b*c*d^2*x+4/3*d^2*b*ln(c*x-1))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (63) = 126\).
time = 0.26, size = 147, normalized size = 2.07 \begin {gather*} \frac {1}{3} \, a c^{2} d^{2} x^{3} + \frac {1}{6} \, {\left (2 \, x^{3} \operatorname {artanh}\left (c x\right ) + c {\left (\frac {x^{2}}{c^{2}} + \frac {\log \left (c^{2} x^{2} - 1\right )}{c^{4}}\right )}\right )} b c^{2} d^{2} + a c d^{2} x^{2} + \frac {1}{2} \, {\left (2 \, x^{2} \operatorname {artanh}\left (c x\right ) + c {\left (\frac {2 \, x}{c^{2}} - \frac {\log \left (c x + 1\right )}{c^{3}} + \frac {\log \left (c x - 1\right )}{c^{3}}\right )}\right )} b c d^{2} + a d^{2} x + \frac {{\left (2 \, c x \operatorname {artanh}\left (c x\right ) + \log \left (-c^{2} x^{2} + 1\right )\right )} b d^{2}}{2 \, c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*d*x+d)^2*(a+b*arctanh(c*x)),x, algorithm="maxima")

[Out]

1/3*a*c^2*d^2*x^3 + 1/6*(2*x^3*arctanh(c*x) + c*(x^2/c^2 + log(c^2*x^2 - 1)/c^4))*b*c^2*d^2 + a*c*d^2*x^2 + 1/
2*(2*x^2*arctanh(c*x) + c*(2*x/c^2 - log(c*x + 1)/c^3 + log(c*x - 1)/c^3))*b*c*d^2 + a*d^2*x + 1/2*(2*c*x*arct
anh(c*x) + log(-c^2*x^2 + 1))*b*d^2/c

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 114, normalized size = 1.61 \begin {gather*} \frac {2 \, a c^{3} d^{2} x^{3} + {\left (6 \, a + b\right )} c^{2} d^{2} x^{2} + 6 \, {\left (a + b\right )} c d^{2} x + b d^{2} \log \left (c x + 1\right ) + 7 \, b d^{2} \log \left (c x - 1\right ) + {\left (b c^{3} d^{2} x^{3} + 3 \, b c^{2} d^{2} x^{2} + 3 \, b c d^{2} x\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )}{6 \, c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*d*x+d)^2*(a+b*arctanh(c*x)),x, algorithm="fricas")

[Out]

1/6*(2*a*c^3*d^2*x^3 + (6*a + b)*c^2*d^2*x^2 + 6*(a + b)*c*d^2*x + b*d^2*log(c*x + 1) + 7*b*d^2*log(c*x - 1) +
 (b*c^3*d^2*x^3 + 3*b*c^2*d^2*x^2 + 3*b*c*d^2*x)*log(-(c*x + 1)/(c*x - 1)))/c

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (63) = 126\).
time = 0.27, size = 131, normalized size = 1.85 \begin {gather*} \begin {cases} \frac {a c^{2} d^{2} x^{3}}{3} + a c d^{2} x^{2} + a d^{2} x + \frac {b c^{2} d^{2} x^{3} \operatorname {atanh}{\left (c x \right )}}{3} + b c d^{2} x^{2} \operatorname {atanh}{\left (c x \right )} + \frac {b c d^{2} x^{2}}{6} + b d^{2} x \operatorname {atanh}{\left (c x \right )} + b d^{2} x + \frac {4 b d^{2} \log {\left (x - \frac {1}{c} \right )}}{3 c} + \frac {b d^{2} \operatorname {atanh}{\left (c x \right )}}{3 c} & \text {for}\: c \neq 0 \\a d^{2} x & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*d*x+d)**2*(a+b*atanh(c*x)),x)

[Out]

Piecewise((a*c**2*d**2*x**3/3 + a*c*d**2*x**2 + a*d**2*x + b*c**2*d**2*x**3*atanh(c*x)/3 + b*c*d**2*x**2*atanh
(c*x) + b*c*d**2*x**2/6 + b*d**2*x*atanh(c*x) + b*d**2*x + 4*b*d**2*log(x - 1/c)/(3*c) + b*d**2*atanh(c*x)/(3*
c), Ne(c, 0)), (a*d**2*x, True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 330 vs. \(2 (63) = 126\).
time = 0.41, size = 330, normalized size = 4.65 \begin {gather*} -\frac {2}{3} \, {\left (\frac {2 \, b d^{2} \log \left (-\frac {c x + 1}{c x - 1} + 1\right )}{c^{2}} - \frac {2 \, b d^{2} \log \left (-\frac {c x + 1}{c x - 1}\right )}{c^{2}} - \frac {2 \, {\left (\frac {3 \, {\left (c x + 1\right )}^{2} b d^{2}}{{\left (c x - 1\right )}^{2}} - \frac {3 \, {\left (c x + 1\right )} b d^{2}}{c x - 1} + b d^{2}\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )}{\frac {{\left (c x + 1\right )}^{3} c^{2}}{{\left (c x - 1\right )}^{3}} - \frac {3 \, {\left (c x + 1\right )}^{2} c^{2}}{{\left (c x - 1\right )}^{2}} + \frac {3 \, {\left (c x + 1\right )} c^{2}}{c x - 1} - c^{2}} - \frac {\frac {12 \, {\left (c x + 1\right )}^{2} a d^{2}}{{\left (c x - 1\right )}^{2}} - \frac {12 \, {\left (c x + 1\right )} a d^{2}}{c x - 1} + 4 \, a d^{2} + \frac {4 \, {\left (c x + 1\right )}^{2} b d^{2}}{{\left (c x - 1\right )}^{2}} - \frac {7 \, {\left (c x + 1\right )} b d^{2}}{c x - 1} + 3 \, b d^{2}}{\frac {{\left (c x + 1\right )}^{3} c^{2}}{{\left (c x - 1\right )}^{3}} - \frac {3 \, {\left (c x + 1\right )}^{2} c^{2}}{{\left (c x - 1\right )}^{2}} + \frac {3 \, {\left (c x + 1\right )} c^{2}}{c x - 1} - c^{2}}\right )} c \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*d*x+d)^2*(a+b*arctanh(c*x)),x, algorithm="giac")

[Out]

-2/3*(2*b*d^2*log(-(c*x + 1)/(c*x - 1) + 1)/c^2 - 2*b*d^2*log(-(c*x + 1)/(c*x - 1))/c^2 - 2*(3*(c*x + 1)^2*b*d
^2/(c*x - 1)^2 - 3*(c*x + 1)*b*d^2/(c*x - 1) + b*d^2)*log(-(c*x + 1)/(c*x - 1))/((c*x + 1)^3*c^2/(c*x - 1)^3 -
 3*(c*x + 1)^2*c^2/(c*x - 1)^2 + 3*(c*x + 1)*c^2/(c*x - 1) - c^2) - (12*(c*x + 1)^2*a*d^2/(c*x - 1)^2 - 12*(c*
x + 1)*a*d^2/(c*x - 1) + 4*a*d^2 + 4*(c*x + 1)^2*b*d^2/(c*x - 1)^2 - 7*(c*x + 1)*b*d^2/(c*x - 1) + 3*b*d^2)/((
c*x + 1)^3*c^2/(c*x - 1)^3 - 3*(c*x + 1)^2*c^2/(c*x - 1)^2 + 3*(c*x + 1)*c^2/(c*x - 1) - c^2))*c

________________________________________________________________________________________

Mupad [B]
time = 0.96, size = 105, normalized size = 1.48 \begin {gather*} \frac {d^2\,\left (6\,a\,x+6\,b\,x+6\,b\,x\,\mathrm {atanh}\left (c\,x\right )\right )}{6}+\frac {c^2\,d^2\,\left (2\,a\,x^3+2\,b\,x^3\,\mathrm {atanh}\left (c\,x\right )\right )}{6}-\frac {d^2\,\left (6\,b\,\mathrm {atanh}\left (c\,x\right )-4\,b\,\ln \left (c^2\,x^2-1\right )\right )}{6\,c}+\frac {c\,d^2\,\left (6\,a\,x^2+b\,x^2+6\,b\,x^2\,\mathrm {atanh}\left (c\,x\right )\right )}{6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*atanh(c*x))*(d + c*d*x)^2,x)

[Out]

(d^2*(6*a*x + 6*b*x + 6*b*x*atanh(c*x)))/6 + (c^2*d^2*(2*a*x^3 + 2*b*x^3*atanh(c*x)))/6 - (d^2*(6*b*atanh(c*x)
 - 4*b*log(c^2*x^2 - 1)))/(6*c) + (c*d^2*(6*a*x^2 + b*x^2 + 6*b*x^2*atanh(c*x)))/6

________________________________________________________________________________________